//
//  ABManager.h
//  GroupManager
//
//  Created by gokei on 11/10/12.
//  Copyright 2011 __MyCompanyName__. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <AddressBook/AddressBook.h>
#import "GMGroup.h"


@interface ABManager : NSObject {
	ABAddressBookRef addressBook;
	CFMutableArrayRef personArray;
	
	NSMutableArray *groups;
}

@property(nonatomic, retain) NSMutableArray* groups;
@property(nonatomic, assign, readonly) ABAddressBookRef addressBook;

+ (ABManager*)sharedManager;
- (void)saveAddressBook;
- (void)initAddressBookInfo;
- (void)reloadAddressBook;
- (void)readAllGroups;
- (int)getGroupCount;
- (NSString*)getGroupNameAtIndex:(int)index;
- (void)updateGroupNameAtIndex:(int)index name:(NSString*)name;
- (void)createGroup:(NSString*)gpName;
- (void)deleteGroupAtIndex:(int)index;

- (void)readAllPersonsOfGroup:(GMGroup*)group;

@end
